<?php
/**
 * 运单费用
 */
class Application_Model_WayFee extends Application_Model_DomainObject{
    
    protected $_id;
    
    protected $_money;
    
    protected $_feeType;
    
    protected $_wayId;


    protected $_feeBy;
    /**
     * 返回费用类型
     * @return Application_Model_FeeType
     */
    public function getFeeBy(){
        if($this->_feeBy==NULL){
            $this->_feeBy = Application_Model_FeeType::load($this->_feeType);
        }
        return $this->_feeBy;
    }
    
    /**
     * 根据运单ID返回该运单的费用明细
     * @param type $wayId
     * @return type
     */
    public static function getByWayId($wayId){
        return self::getDao()->queryAll(array('wayId'=>$wayId));
    }
    
    public static function getByWayIdFeeType($wayId,$feeType)
    {
        return self::getDao()->queryOne(array("wayId"=>$wayId,"feeType"=>$feeType));
    }
}